package mdb

const (
	defaultMaxPoolSize = 10
)

type Options struct {
	MaxPoolSize int
}

func NewOptions(opts ...Option) Options {
	o := Options{
		MaxPoolSize: defaultMaxPoolSize,
	}

	for _, opt := range opts {
		opt(&o)
	}

	return o
}

// Option is a function to set the db options.
type Option func(*Options)

// WithMaxPoolSize let you set the max number of connection that could be opened.
func WithMaxPoolSize(n int) Option {
	return func(o *Options) {
		o.MaxPoolSize = n
	}
}
